<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/view/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
	 <link href="${project}/ds/css/input.css" rel="stylesheet" />
    <link href="${project}/ds/lib/layui/css/layui.css" rel="stylesheet" />
    <title>在线实时统计</title>
    <style type="text/css">
        p{margin:0;}
         #content {
             width: 800px;
             margin: 0 auto;
             padding: 10px 0 0 0;
         }
         .onlinediv {
            margin:10px 0;
            color: #fff;
        }
            .onlinediv p {
                margin-left: 5px;
                margin-top: 2px;
                font: 16px/24px 微软雅黑;
            }
            .onlinediv div {
                font: bold 26px/70px 微软雅黑;
                text-align: center;
            }
        
        #div1, #div2, #div3, #div4 {
            width: 100%;
        }

        #div1_1, #div1_2, #div2_1, #div2_2, #div3_1, #div3_2 {
            width: 390px;
            height: 120px;
        }

        #div1_1, #div2_1, #div3_1 {
            float: left;
        }
        #div1_2, #div2_2, #div3_2 {
            float: right;
        }

        #div1_1 {
            background: #ec8214;
        }
        #div1_2 {
            background: #dd00ff;
        }
        #div2_1 {
            background: #920000;
        }
            #div1_1 div, #div1_2 div{
                line-height: 40px;
            }
            #div2_1 div, #div2_2 div, #div3_1 div, #div3_2 div {
                line-height: 65px;
            }
        #div2_2 {
            background: #130074;
        }
        #div3_1 {
            background: #14a7ec;
        }
        #div3_2 {
            background: #246b0d;
        }
        #div4 {
            background: #ec1414;
            height: 120px;
        }
    </style>
</head>
<body>
    <div id="content">
        <div id="div1" class="clearfix">
            <div id="div1_1" class="onlinediv">
                <p>管理客户人数：</p>
                <div id="allpersona"></div>
                <p id="logina"></p>
                <p id="unlogina"></p>
            </div>
            <div id="div1_2" class="onlinediv">
                <p>认筹客户人数：</p>
                <div id="allpersonb"></div>
                <p id="loginb"></p>
                <p id="unloginb"></p>
            </div>
        </div>
        <div id="div2" class="clearfix">
            <div id="div2_1" class="onlinediv">
                <p id="roomcount">已售房源：</p>
                <div id="saleroom"></div>
                <p id="salemessage"></p>
            </div>
            <div id="div2_2" class="onlinediv">
                <p>已收藏房间数：</p>
                <div id="collectionroomcount"></div>
            </div>
        </div>
        <div id="div3" class="clearfix">
            <div id="div3_1" class="onlinediv">
                <p>管理在线人数：</p>
                <div id="allonlinea"></div>
                <p id="collectionusercounta"></p>
            </div>
            <div id="div3_2" class="onlinediv">
                <p>认筹在线人数：</p>
                <div id="allonlineb"></div>
                <p id="collectionusercountb"></p>
            </div>
        </div>
        <!--    <div id="div3" class="clearfix">-->
        <!--        <div id="div3_1" class="onlinediv">-->
        <!--        </div>-->
        <!--        <div id="div3_2" class="onlinediv">-->
        <!--            <p>未售房源：</p>-->
        <!--        </div>-->
        <!--    </div>-->
        <div id="div4" class="clearfix">
            <div id="div4_1" class="onlinediv">
                <p>成交金额：</p>
                <div id="total"></div>
            </div>
        </div>
    </div>
    

<script src="${project}/ds/lib/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
<%-- <script src="${project}/ds/js/js/ws.js" type="text/javascript"></script> --%>
<script src="${project}/ds/js/layeralert.js" type="text/javascript"></script>
<script src="${project}/ds/lib/layui/layui.js" type="text/javascript"></script>
<script src="${project}/ds/js/XHD.js" type="text/javascript"></script>
<script src="${project}/ds/js/room/command.js" type="text/javascript"></script>
<script type="text/javascript">
    var usertype = 3;
    var user = getCookie("xhdcrm_uid");
    var layerindex = 0;
    var layer;
    var BusType = 1;
   /*  layui.use(['layer'],
        function () {
            layer = layui.layer;
            loadin();
            websocketConnect();
            setTimeout(function () {
                setInterval(function () {
                    var json = wsorder.getroomstate(user);
                    websocket.send(JSON.stringify(json));
                }, 3000);
            }, 1000);
        }); */
	$(function(){
		/* setTimeout(function () {
			getOnLineInfo();
        }, 3000); */
		getOnLineInfo()
	})
	function getOnLineInfo(){
        	  $.ajax({
                  url: "/online/getOnLineInfo",
                  type: "post",
                  async: true,
                  dataType: "json",
                  success: function(data) {
                	  RoomOnlineInfo(data) 
                  }
              });
        }
    function RoomOnlineInfo(data) {
        $("#allpersona").html(data.UserCountA + "人");
        $("#logina").html("已登录过人数：" + data.LoginCountA + "人");
        $("#unlogina").html("未登录过人数：" + data.UnLoginCountA + "人");
        
        $("#allonlinea").html(data.OnlineCountA + "人");
        $("#collectionusercounta").html("已收藏人数:" + data.CollectionUserCountA + "人");

        $("#allpersonb").html(data.UserCountB + "人");
        $("#loginb").html("已登录过人数：" + data.LoginCountB + "人");
        $("#unloginb").html("未登录过人数：" + data.UnLoginCountB + "人");
        $("#allonlineb").html(data.OnlineCountB + "人");
        $("#collectionusercountb").html("已收藏人数:" + data.CollectionUserCountB + "人");

        $("#roomcount").html("已售房源（总房源数：" + data.RoomCount + "）：");
        $("#saleroom").html(data.SaleRoomCount + "套");
        $("#salemessage").html("内控：" + data.MonitorSaleRoomCount + "套" + " 销售：" + data.UnMonitorSaleRoomCount + "套" + " 剩余：" + data.UnSaleRoomCount + "套" + " 售房率：" + data.SaleRoomProportion + "%");
        
        $("#collectionroomcount").html(data.CollectionRoomCount + "套");
               
        var total = ReplacePriceToThousand(data.Total);
        $("#total").html(total + "元");
        
        //layer.close(layerindex);
    }
</script>
</body>
</html>